<?php
class media_draft_env_model extends CI_Model {

	public function __construct(){
		parent::__construct();
		$this->db = $this->load->database('default',true);
	}

	public function save_media_draft_env($type,$env_id,$media_draft_id) {
		$data=array("media_draft_id"=>$media_draft_id,
				"env_type"=>$type,
				"env_id"=>$env_id);
		$this->db->insert("media_draft_env",$data);
	}

	public function delete_media_draft_env($media_draft_id){
		$sql ="delete from  media_draft_env where media_draft_id ='$media_draft_id'";
		$this->db->query($sql);
	}

	public function  query_media_draft_env_list($media_draft_id){
		$sql ="select * from media_draft_env where media_draft_id ='$media_draft_id'";
		$query =$this->db->query($sql);
		if ($query) {
			return $query->result_array();
		}
	}
}